package com.cy.pj.sys.service.impl;

import com.cy.pj.sys.dao.SysLogDao;
import com.cy.pj.sys.pojo.SysLog;
import com.cy.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysLogServiceImpl implements SysLogService
{
    @Autowired
    private SysLogDao sysLogDao;

    @Async
    @Override
    public void saveLog(SysLog sysLog)
    {
        sysLogDao.insertLog(sysLog);
    }

    @Override
    public int deleteById(Long... ids)
    {
        return sysLogDao.deleteById();
    }

    @Override
    public SysLog findById(Long id)
    {
        return sysLogDao.selectById(id);
    }

    @Override
    public List<SysLog> findLogs(SysLog sysLog)
    {
        return sysLogDao.selectLogs(sysLog);
    }
}
